package cn.itcast.nems.config;

import cn.itcast.nems.manager.redis.RedisUtil;
import cn.itcast.nems.manager.weixin.WeixinManager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * <p>
 * Weixin Manager 初始化配置
 * </p>
 *
 * @author liyong
 * @since 2024/3/20
 **/
@Configuration
public class WeixinManagerConfig {
    @Value("${weixin.webhook.key}")
    private String webhookKey;

    @Autowired
    private RedisUtil redisUtil;

    @Bean
    public WeixinManager weixinManger() {
        WeixinManager wm = new WeixinManager(this.webhookKey);
        wm.setRedisUtil(this.redisUtil);
        return wm;
    }
}
